<?php

/**
 * ProveedorAudit form base class.
 *
 * @method ProveedorAudit getObject() Returns the current form's model object
 *
 * @package    MercaderDigital
 * @subpackage form
 * @author     Germán Figueredo
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseProveedorAuditForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_Audit'      => new sfWidgetFormInputHidden(),
      'id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Proveedor'), 'add_empty' => true)),
      'RazonSocial'   => new sfWidgetFormInputText(),
      'email_address' => new sfWidgetFormInputText(),
      'TelFijo'       => new sfWidgetFormInputText(),
      'TelCel'        => new sfWidgetFormInputText(),
      'Calle'         => new sfWidgetFormInputText(),
      'Numero'        => new sfWidgetFormInputText(),
      'Piso'          => new sfWidgetFormInputText(),
      'Dpto'          => new sfWidgetFormInputText(),
      'Barrio'        => new sfWidgetFormInputText(),
      'Distrito'      => new sfWidgetFormInputText(),
      'Detalles'      => new sfWidgetFormTextarea(),
      'CUIT'          => new sfWidgetFormInputText(),
      'fechaEvento'   => new sfWidgetFormInputHidden(),
      'Evento'        => new sfWidgetFormInputHidden(),
      'id_user_ev'    => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id_Audit'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_Audit')), 'empty_value' => $this->getObject()->get('id_Audit'), 'required' => false)),
      'id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Proveedor'), 'required' => false)),
      'RazonSocial'   => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'email_address' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'TelFijo'       => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'TelCel'        => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'Calle'         => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'Numero'        => new sfValidatorInteger(array('required' => false)),
      'Piso'          => new sfValidatorInteger(array('required' => false)),
      'Dpto'          => new sfValidatorInteger(array('required' => false)),
      'Barrio'        => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'Distrito'      => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'Detalles'      => new sfValidatorString(array('max_length' => 4000)),
      'CUIT'          => new sfValidatorString(array('max_length' => 4000, 'required' => false)),
      'fechaEvento'   => new sfValidatorPass(array('required' => false)),
      'Evento'        => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'id_user_ev'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('UsuarioEvento'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('proveedor_audit[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProveedorAudit';
  }

}
